package com.frejoys.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.common.appversion.AppVersionAddDto;
import com.frejoys.common.dto.common.appversion.AppVersionInfoDto;
import com.frejoys.common.dto.common.appversion.AppVersionListDto;
import com.frejoys.common.dto.common.IdDto;
import com.frejoys.dao.entity.AppVersion;

import java.util.List;

public interface AppVersionService extends IService<AppVersion> {

    default AppVersion getOnly(QueryWrapper<AppVersion> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default AppVersion getOnly(LambdaQueryWrapper<AppVersion> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    /**
     * 添加
     * @param dto
     * @return
     */
    boolean addInfo(AppVersionAddDto dto);

    /**
     * 删除
     * @param dto
     * @return
     */
    boolean delInfo(IdDto dto);

    /**
     * 最新一条信息
     * @param dto
     * @return
     */
    AppVersion getLastInfo(AppVersionInfoDto dto);

    /**
     * 列表
     * @param dto
     * @return
     */
    List<AppVersion> listInfo(AppVersionListDto dto);

}
